package com.xdb.sqlparser.dialect.mysql.ast.statement;

import java.util.ArrayList;
import java.util.List;

import com.xdb.sqlparser.ast.SQLExpr;
import com.xdb.sqlparser.ast.SQLName;
import com.xdb.sqlparser.ast.statement.SQLTableElement;
import com.xdb.sqlparser.dialect.mysql.ast.MySqlObjectImpl;
import com.xdb.sqlparser.dialect.mysql.visitor.MySqlASTVisitor;

public class MySqlTableIndex extends MySqlObjectImpl implements SQLTableElement {

	private SQLName name;
	private String indexType;
	private List<SQLExpr> columns = new ArrayList<SQLExpr>();

	public MySqlTableIndex() {

	}

	public SQLName getName() {
		return name;
	}

	public String getIndexType() {
		return indexType;
	}

	public void setIndexType(String indexType) {
		this.indexType = indexType;
	}

	public void setName(SQLName name) {
		this.name = name;
	}

	public List<SQLExpr> getColumns() {
		return columns;
	}

	public void accept0(MySqlASTVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, name);
			acceptChild(visitor, columns);
		}
		visitor.endVisit(this);
	}
}
